package me.luochenyxh.base.base.status

/**
 * @创建者：XH-hua
 * @创建时间：2021/6/19 9:50
 * @描述：
 */
object AppStatus {
    const val STATUS_RECYCLE = -1 //被回收
    const val STATUS_NORMAL = 1 //正常
}

object AppStatusManager {

    private var mAppStatus = AppStatus.STATUS_RECYCLE //APP状态 初始值被系统回收

    //得到状态
    fun getAppStatus(): Int {
        return mAppStatus
    }

    //设置状态
    fun setAppStatus(appStatus: Int) {
        this.mAppStatus = appStatus
    }

    /**被回收 */
    fun isRecycle(): Boolean {
        return getAppStatus() == AppStatus.STATUS_RECYCLE
    }
}